const state = {
  // layoutComponents : formLayoutData ? formLayoutData:layoutComponents, // 缓存中间表单数据
  // layoutComponents,//不使用缓存
  // selectWidget: {}, // fromMaking选中的控件
  // configData: {},//控件的配置数据
  form:{},
  element:{},
  modeler:{}
}

const mutations = {

  // 处理中间表单的数据
  handleForm(state, payload) {
    console.log(payload)
    state.form = payload
    console.log(state.form )
      
  },
  handleModeler(state, payload) {
    // console.log(payload)

      state.element = payload
  },
  handleElement(state, payload) {
    // console.log(payload)

      state.modeler = payload
  },

  // handleElement(state, payload) {
  //     let configOptions = {
  //         components: payload.options,
  //         control: payload.control.options
  //     }
  //     state.selectWidget = payload
  //     state.configData = configOptions
  // },
  // // 处理选中的控件的配置文件
  // handleControlConfig(state, payload) {
  //     console.log(payload)
  // },
}

const actions = {

}

export default {
  state,
  mutations,
  actions
}
